using System;

namespace Voodoo.Sauce.Internal.SDKs
{
	[Serializable]
	public class SDK
	{
		public string name;

		public string icon;

		public SDKVersions versions;

		public override bool Equals(object obj)
		{
			if (obj == null || GetType() != obj.GetType())
			{
				return false;
			}
			SDK sDK = (SDK)obj;
			if ((name ?? "") != (sDK.name ?? "") || (icon ?? "") != (sDK.icon ?? "") || ((versions == null || versions.IsEmpty()) && sDK.versions != null && !sDK.versions.IsEmpty()) || (versions != null && !versions.Equals(sDK.versions)))
			{
				return false;
			}
			return true;
		}

		public string[] GetVersionsAsArray()
		{
			return new string[3] { versions.unity, versions.ios, versions.android };
		}

		public override int GetHashCode()
		{
			return (((((name != null) ? name.GetHashCode() : 0) * 397) ^ ((icon != null) ? icon.GetHashCode() : 0)) * 397) ^ ((versions != null) ? versions.GetHashCode() : 0);
		}

		public bool IsEmpty()
		{
			if (string.IsNullOrEmpty(name) && string.IsNullOrEmpty(icon) && (versions == null || versions.IsEmpty()))
			{
				return true;
			}
			return false;
		}
	}
}
